﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Script.Services;
using System.Data;
using System.Data.SqlClient;
using SqlServerWrapper;
using ResponseObject;
using BartonExtension;
using Model.User;
using Model;

namespace WebSrvs.NET
{
    /// <summary>
    /// ZK_MessagePushService 的摘要说明
    /// </summary>
    /// 
    [System.Web.Script.Services.ScriptService]
    [WebService(Namespace = "http://zker.hk/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务，请取消注释以下行。 
    // [System.Web.Script.Services.ScriptService]
    public class ZK_MessagePushService : System.Web.Services.WebService
    {

        [WebMethod]
        [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
        public string ApplePushNotification(string pwd,string deviceToken,string alert,int badge,string sound)
        {
            ZKResponse response = new ZKResponse();
            try
            {
                PushExtension.pushIOSDeviceNotification(pwd, deviceToken, alert, badge, sound);
            }
            catch (Exception ex)
            {
                response.errCode = ErrorCodes.CODE_ERR_INTERNAL_ERR;
                response.errMsg = ex.Message;
            }
            return response.ToJson();
        }
    }
}
